package com.ae.shield.common.items.util;

import com.ae.shield.AEShieldMod;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class ToolItem extends Item {
    public ToolItem() {
        this(300);
    }

    public ToolItem(int maxDamage) {
        super(new Properties().maxDamage(maxDamage).group(AEShieldMod.AE_SHIELD));
    }

    @Override
    public boolean hasContainerItem(ItemStack stack) {
        return true;
    }

    @Override
    public ItemStack getContainerItem(ItemStack itemStack) {
        ItemStack copy = itemStack.copy();
        if (copy.attemptDamageItem(1, random, null)) {
            return ItemStack.EMPTY;
        }else {
            return copy;
        }
    }
}
